import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

function load(component) {
    return () =>
        import (`@/views/${component}.vue`)
}

export default new Router({
    routes: [
        {
            path: '/',
            name: 'home',
            component: load('index')
        },
        {
            path: '/place',
            name: 'place',
            component: load('place')
        },
        {
            path: '/result',
            name: 'result',
            component: load('result')
        },
        {
            path: '/detail/:id',
            name: 'detail',
            component: load('detail')
        },
        {
            path: '/placeImg/:id',
            name: 'placeImg',
            component: load('placeImg')
        },
        {
            path: '/placeDetail/:id',
            name: 'placeDetail',
            component: load('placeDetail')
        },
        {
            path: '/planPrice',
            name: 'planPrice',
            component: load('planPrice')
        },
        {
            path: '/myPlans',
            name: 'myPlans',
            component: load('plans')
        },
    ]
})
